<?php header("Content-Type:text/html;   charset=utf-8"); ?>
<script type="text/javascript">
	$(function(){
		$("a[href='#maximize']").trigger("click");	
		loadAlbumsDetails();
		$("#btnSubmitDeleteAlbumDetail").bind("click",deleteAllAlbumDetail);
	});
	function deleteAllAlbumDetail(){
		if(confirm('确定要全部删除吗？')){
			var params = {id:$("#hdid").val()};
			$.ajax({
				type:"post",
				url:"admin.php/manage/deleteByAlbumid",
				dataType:"json",
				data:params,
				success:function(data){
					alert('删除成功');
					loadAlbumsDetails();
				}
			});
		}
	}
	function loadAlbumsDetails(){
		var id = $("#hdid").val();
		var params = {id:id};
		
		$.ajax({
			type:"post",
			url:"admin.php/manage/loadAlbumDetails",
			dataType:"json",
			data:params,
			success:function(data){
				$("#ulAlbumDetail").html(data.album);									
			}
		});
	}
	function delalbumdetail(id){
		if(confirm('确认要将其删除吗？')){
			var params = {id:id};
			$.ajax({
				type:"post",
				url:"admin.php/manage/delAblumDetails",
				dataType:"json",
				data:params,
				success:function(data){
					alert("删除成功");
					loadAlbumsDetails();
				}
			});
		}
	}
	function ablumTrash(id){
		$("#hrefEditAlbum").attr("href","admin.php/manage/albumtrash?id="+id).text("回收站管理");
		$("#hrefEditAlbum").trigger("click");
	}
	function backtoablum(id){		
		$("#hrefEditAlbum").attr("href","admin.php/manage/album?id="+id).text("相册管理");
		$("#hrefEditAlbum").trigger("click");
	}
</script>
<div class="pageContent">
	<form class="pageForm required-validate"
		onsubmit="return validateCallback(this, navTabAjaxDone);">
		<li style="display: none"><a id="hrefEditAlbum" class="edit" href=""
			lookupgroup="orgLookup"><span>修改</span></a></li>
		<div class="panelBar">
			<ul class="toolBar">
				<li><a onclick='backtoablum(<?php echo $_GET["uid"];?>)'
					class="edit" href="javascript:void(0)"><span>相册管理</span></a></li>
				<li><a onclick='ablumTrash(<?php echo $_GET["uid"];?>)' class="edit"
					href="javascript:void(0)"><span>回收站管理</span></a></li>

			</ul>
		</div>
		<div class="pageFormContent" style="float: left; width: 100%;"
			layoutH="56">
			<div class="xiangce" style="width: 100%; height: 100%">
				<ul id="ulAlbumDetail">
				</ul>
				<div class="button" style="clear: both; margin-left:400px;margin-top:50px;">
					<div class="buttonContent">
						<button id="btnSubmitDeleteAlbumDetail" type="button"
							style="width: 80px">全部删除</button>
					</div>
				</div>
			</div>

		</div>



		<input type="hidden" id="hdid"
			value="<?php if(isset($_GET["id"])) print $_GET["id"]; else print 0;?>">
		<input type="hidden" id="hduid"
			value="<?php if(isset($_GET["uid"])) print $_GET["uid"]; else print 0;?>">

		<div class="pageFormContent"
			style="float: right; width: 460px; overflow: auto;" layoutH="56"
			id="divExistsNew"></div>
	</form>
</div>
